import java.util.Scanner;
public class Task08 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int m = sc.nextInt();
		int n = sc.nextInt();
		int l = sc.nextInt();
		sc.close();
		int [] line1Holes = new int[l/m +1];
		int [] line2Holes = new int [l/n +1];
		int line1Counter = 0;
		int line2Counter = 0;
		int matchingCounter = 0;
		
		
		for (int i=0; i<=l; i += m){	
			line1Holes[line1Counter] = i;
			line1Counter++;
		}
		
		for (int i=0;i<=l;i+=n){
			line2Holes[line2Counter] = i;
			line2Counter++;
		}
		for (int i=0;i<=l/m;i++)
			for(int j=0;j<=l/n;j++){
				if (line1Holes[i] == line2Holes[j])
					matchingCounter++;
			}
		System.out.println(matchingCounter);
		
		

	}

}
